package org.stvd.service.logs.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.stvd.core.dto.QueryResult;
import org.stvd.core.util.DateUtil;
import org.stvd.core.util.IdWorker;
import org.stvd.entities.logs.SysOperLog;
import org.stvd.repository.logs.SysOperLogDao;
import org.stvd.service.base.impl.BaseServiceImpl;
import org.stvd.service.logs.SysOperLogService;

/**
 * @Title: SysOperLogServiceImpl
 * @Description: 系统操作日志业务层实现类
 * @author houzx
 * @date 2020年9月2日
 */
@Service("SysOperLogService")
public class SysOperLogServiceImpl extends BaseServiceImpl<SysOperLog> implements SysOperLogService{

    @Resource(name="SysOperLogDao")
    private SysOperLogDao sysOperLogDao;
    
    @Override
    public void insertOperlog(SysOperLog operLog) {
        if(operLog!=null) {
            operLog.setOperId(IdWorker.getInstance().nextId());
            operLog.setOperTime(DateUtil.getSystemDate());
            sysOperLogDao.insert(operLog);
        }
    }

    @Override
    public QueryResult<SysOperLog> queryOperLogResult(int start, int limit,
        String title, Integer businessType, Integer operatorType, String operIp, String operName, Integer status, 
        Date queryStartDate, Date queryEndDate) {
        return sysOperLogDao.queryOperLogResult(start, limit, title, businessType, operatorType, operIp, operName, status, queryStartDate, queryEndDate);
    }

}
